<?php
/**
 * 格式化金额数字
 *
 *
 */
function money_num($num, $num_lite_style = 'num_lite') {
    $num_arr = explode('.', $num);
    if(!isset($num_arr[1])) {
        $num_arr[1] = '00';
    }
    $num_arr[1] = '<span class="'.$num_lite_style.'">'.$num_arr[1].'</span>';
    return implode('.', $num_arr);
}

/**
 * 日志记录
 *
 *
 */
function log_write($message='') {
	$file_path = dirname(dirname(__FILE__)).'/'.date('ym').'_log.txt';
	$time = time();
	$time = date('m-d H:i:s', $time);
	$log = '';
	
	$db = new IncomeModel();
	$inc_sum = $db->get_sum();
	
	$log .= $time;
	$log .= ' - ';
	$log .= '['.$inc_sum.'] '.$message;
	$log .= "\r\n";
	
	file_put_contents($file_path, $log, FILE_APPEND);
}
?>
